from sqlalchemy import Column, String, text,Integer,SmallInteger,Boolean
from app.db.base_class import Base

__all__ = [
    'Album', 'common_album', 'common_album_cate', 'AlbumCate'
]
class Album(Base):
    """相册管理表"""
    __tablename__ = 'la_album'
    __table_args__ = {
        'comment': '相册管理表',}

    cid = Column(Integer, nullable=False, index=True, comment='类目ID')
    aid = Column(Integer, nullable=False, comment='管理员ID')
    uid = Column(Integer, nullable=False, comment='用户ID')

    type = Column(SmallInteger, nullable=False, server_default=text('10'),comment='文件类型: 10=图片,  20=视频')
    name = Column(String(100), nullable=False, default='', comment='文件名称')
    uri = Column(String(200), nullable=False, default='', comment='文件路径')
    ext = Column(String(10), nullable=False, default='', comment='文件扩展')
    size = Column(Integer, nullable=False, comment='文件大小')


class AlbumCate(Base):
    __tablename__ = 'la_album_cate'
    __table_args__ = {'comment': '相册分类表',}

    pid = Column(Integer, nullable=False, server_default=text('0'), comment='父级ID')
    type = Column(SmallInteger, nullable=False, server_default=text('10'),comment='文件类型: 10=图片,  20=视频')
    name = Column(String(100), nullable=False, default='', comment='分类名称')


common_album = Album.__table__
common_album_cate = AlbumCate.__table__
